package zuoye;

import java.util.Scanner;

public class Bubble1 {
	/* 1、使用二维数组存储班上五个学生三门功课的考试成绩，要求输出每一个学生的总分、平均分、最高分、最低分 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double[][] scores = new double[5][3];
		for (int i = 0; i < scores.length; i++) {
			System.out.println("请输入第" + (i + 1) + "位学员的成绩：");
			for (int j = 0; j < scores[i].length; j++) {
				System.out.print("\t请输入第" + (j + 1) + "门课的成绩：");
				scores[i][j] = sc.nextInt();
			}
		}
		double sum = 0.0, avg = 0.0, max = 0.0, min = 0.0;
		for (int i = 0; i < scores.length; i++) {
			sum = 0;
			max = min = scores[i][0];
			for (int j = 0; j < scores[i].length; j++) {
				sum += scores[i][j];
				if (max < scores[i][j]) {
					max = scores[i][j];
				}
				if (min > scores[i][j]) {
					min = scores[i][j];
				}
			}
			System.out.println("*************************");
			System.out.println("第" + (i + 1) + "名学生的总成绩：" + sum + "分");
			System.out.println("第" + (i + 1) + "名学生的平均成绩：" + avg + "分");
			System.out.println("第" + (i + 1) + "名学生的最高分：" + max + "分");
			System.out.println("第" + (i + 1) + "名学生的最低分：" + min + "分");
		}
	}

}
